home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Extravaganza - Disc 4
/
Shareware Extravaganza - Over 25,000 Programs (The Ultimate Shareware Company)(Disc 4 of 4)(1993).iso
/
cad
/
jul90.zip
/
TIP557.LSP
< prev
next >
Wrap
Text File
|
1990-07-09
|
992b
|
43 lines
;TIP557.LSP Show Block Occurrences (c)1990, Brian Sallade
(defun C:SHBLKS (/ A B C CNTR)
(setq SEARCH nil)
(while (= SEARCH nil)
(setq A (strcase (getstring
"\nBlock to show or <ALL>: "))
)
(If (= A "") (setq A "ALL"))
(If (= A "ALL")
(setq SEARCH T)
(setq SEARCH
(tblsearch "block" A))
)
(If (= SEARCH nil)
(prompt (strcat
"No block named " A " found."))
)
)
(setq B (entnext) CNTR 0)
(While (boundp 'B)
(setq C (entget B))
(if (= (cdr (assoc 0 C)) "INSERT")
(progn
(If (= A "ALL") (progn
(setq CNTR (1+ CNTR))
(redraw (cdr (assoc -1 C)) 3)
))
(If (= (cdr (assoc 2 C)) A)
(progn
(setq CNTR (1+ CNTR))
(redraw (cdr(assoc -1 C)) 3)
)
)
)
)
(setq B (entnext B))
)
(prompt (strcat "Showed "
(itoa CNTR) " occurances of " A))
(princ)
)